home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
apps
/
29
/
pascal
/
antenna.pas
next >
Wrap
Pascal/Delphi Source File
|
1985-11-19
|
3KB
|
87 lines
program antenna;
const
half_wave_dipole = 468.0;
maxlines = 60;
var
printer : text;
printer_name : string;
f1,f2,f3,f4 : real;
ft,inch : real;
raw_ft : real;
ans : char;
pcnt,lcnt : integer;
procedure Page_header;
begin
page(printer);
writeln(printer,' ':70,'Page ',pcnt:4);
write(printer,' ':15,'Antenna Calculations for a Half-Wave ');
writeln(printer,'Dipole');
writeln(printer);
writeln(printer,'Starting Frequency: ',f1:10:6,' MHZ');
writeln(printer,'Ending Frequency: ',f2:10:6,' MHZ');
writeln(printer,'Step of Calculation: ',f3:10:6,' MHZ');
writeln(printer);
write(printer,' Frequency ':25,' ':10);
writeln(printer,' Length ':40);
write(printer,'Megahertz Meters ':25,' ':10);
writeln(printer,'Feet and Inches Feet ':40);
writeln(printer);
lcnt := 10;
end;
function half_wave(freq : real):real;
begin
half_wave := half_wave_dipole / freq;
end;
procedure feet_to_feet_and_inches(feet : real; var new_feet,inches : real);
begin
new_feet := trunc(feet) * 1.0;
inches := (feet - new_feet) * 12.0;
end;
begin
write('Output Device or File (e.g. LST:): ');
readln(printer_name);
rewrite(printer,printer_name);
repeat
repeat
write('Low End Frequency in MHZ.: ');
readln(f1);
write('High End Frequency in MHZ.: ');
readln(f2);
write('Step in Mhz.: ');
readln(f3);
until f2 >= f1;
f4 := f1;
pcnt := 1;
page_header;
repeat
raw_ft := half_wave(f4);
feet_to_feet_and_inches(raw_ft,ft,inch);
writeln(printer,f4:10:6,' ':5,300.0/f4:10:6,
' ':10,trunc(ft):5,' feet ',
inch:5:2,' inches ',
' ':5,raw_ft:10:6,' feet');
f4 := f4 + f3;
lcnt := lcnt + 1;
if lcnt > maxlines then begin
pcnt := pcnt + 1;
page_header;
end;
until f4 > f2;
repeat
write('Another Run (Y/N): ');
readln(ans);
until ans in ['Y','N','y','n'];
until ans in ['N','n'];
close(printer);
end.
-----------------------------------------------------------------------------------